<!-- 自定义权限组件 -->
<script lang="ts" setup>
import { useUserStore } from '@/stores/user';
import { computed, useSlots } from 'vue';
const props = withDefaults(defineProps<{
  btnPerm?: string
}>(), {
  btnPerm: ''
})

const isShow = computed(() => {
  const store = useUserStore()
  const perms = store.profile.permissions
  return perms.includes(props.btnPerm) || perms.includes('*:*:*')
})

</script>

<template>
  <slot v-if="isShow"></slot>
  <span v-else></span>
</template>